package com.tt.fashionWebSite.domain;

import javax.persistence.*;
import java.io.Serializable;

@SuppressWarnings("serial")
@Entity
@Table(name = "san_pham")
@NamedQueries({
        @NamedQuery(name = "getProductCommon", query = "SELECT c FROM SanPham c") ,
        @NamedQuery(name = "getProductAllWidthCategoryM",query = "SELECT s FROM SanPham s " +
                "WHERE s.loaiDanhMucSanPham.maLoaiDMSP = :maLoaiDMSP AND s.doiTuong = 'NAM' ") ,
        @NamedQuery(name = "getProductAllWidthCategoryF",query = "SELECT s FROM SanPham s " +
                "WHERE s.loaiDanhMucSanPham.maLoaiDMSP = :maLoaiDMSP AND s.doiTuong = 'NỮ' ") ,
})
public class SanPham implements Serializable {

    public static final String GET_PRODUCT_ALL = "getProductCommon";
    public static final String GET_PRODUCT_ALL_WIDTH_CATEGORYM = "getProductAllWidthCategoryM";
    public static final String GET_PRODUCT_ALL_WIDTH_CATEGORYF = "getProductAllWidthCategoryF";

    @Id
    @Column(name = "MA_SP")
    private String maSP;

    @ManyToOne
    @JoinColumn(name = "MA_LOAI_DM_SP")
    private LoaiDanhMucSanPham loaiDanhMucSanPham;

    @Column(name = "TEN_SP")
    private String tenSP;

    @Column(name = "THONG_TIN")
    private String thongTin;

   @Column(name = "DOI_TUONG")
   private String doiTuong;

    public String getMaSP() {
        return maSP;
    }

    public void setMaSP(String maSP) {
        this.maSP = maSP;
    }

    public String getTenSP() {
        return tenSP;
    }

    public void setTenSP(String tenSP) {
        this.tenSP = tenSP;
    }

    public String getThongTin() {
        return thongTin;
    }

    public void setThongTin(String thongTin) {
        this.thongTin = thongTin;
    }

   public LoaiDanhMucSanPham getLoaiDanhMucSanPham() {
      return loaiDanhMucSanPham;
   }

   public void setLoaiDanhMucSanPham(LoaiDanhMucSanPham loaiDanhMucSanPham) {
      this.loaiDanhMucSanPham = loaiDanhMucSanPham;
   }

   public String getDoiTuong() {
      return doiTuong;
   }

   public void setDoiTuong(String doiTuong) {
      this.doiTuong = doiTuong;
   }
}
